<?php
if (!defined('IN_XLP')) {
    exit('Access Denied');
}
$Document = array(
    'pageid' =>'power-index', //页面标示
    'pagename' => '用户特殊权限管理列表', //当前页面名称
    'mycss' => array(), //加载的css样式表
    'myjs' => array(), //加载的js脚本
  'footerjs'=>array('content/fuelux/fuelux', 'content/combodate/moment.min','content/jquery.smoothConfirm'),
    'head' => true, //加载头部文件
);

include getTpl('header', 'public');
?>
<!--顶部导航 开始-->
<?php include getTpl('top', 'public');?>
<!--顶部导航 结束-->
<!--左侧菜单 开始-->
<?php include getTpl('nav', 'public');?>
<!--左侧菜单 结束-->
<!--主体 开始-->
<!-- content -->
<section id="content">
  <!-- main padder -->
  <section class="main padder">
    <div class="clearfix">
      <h4> <i class="fa fa-table"></i>
        <?php echo trim($Document['pagename'],'_');?></h4>
    </div>

    <div class="row">

      <!-- table 11 -->
      <div class="col-lg-12">
        <section class="panel">
        <!---->
          <div class="panel-body">
            <div class="row text-small">
              <div class="col-sm-8">
                  <div class="block btn-group">
                     <a class="btn btn-default" href="<?php echo U('power/index',array('all'=>1));?>">全部</a>
                     <a class="btn btn-default" href="<?php echo U('power/index',array('status'=>1));?>">申请</a>
                     <a class="btn btn-default" href="<?php echo U('power/index',array('status'=>2));?>">通过</a>
                     <a class="btn btn-default" href="<?php echo U('power/index',array('status'=>3));?>">无效</a>
                  </div>
              </div>
              <div class="col-sm-4">
              </div>
            </div>
          </div>
          <!---->
          <div class="table-responsive">
            <table class="table table-striped b-t text-small">
              <thead>
                <tr>
                  <th align="center">ID</th>
                  <th align="center">小区</th>
                  <th align="center">用户</th>
                  <th align="center">拼车</th>
                  <th align="center">论坛</th>
                  <th align="center">二手置换</th>
                  <th align="center">家政</th>
                  <th align="center">小区时景</th>
                  <th align="center">状态</th>
                  <th align="center">申请时间</th>
                  <th align="center">操作</th>
                </tr>
              </thead>
              <tbody>
                <?php  
				if ($rs){
					foreach($rs as $val){
			    ?>
                <tr id="list_detail_<?php echo $val['id'];?>">
                  <td><?php echo $val['id'];?></td>
                  <td><a href="<?php echo U('power/index',array('village_id'=>$val['village_id']));?>"><?php echo $val['village_name'];?></a></td>
                  <td><a href="<?php echo U('power/index',array('uid'=>$val['uid']));?>"><?php echo $val['user_name'];?></a></td>
                  <td align="center"><?php echo $type[$val['allow_carpool']];?></td>
                  <td align="center"><?php echo $type[$val['allow_forum']];?></td>
                  <td align="center"><?php echo $type[$val['allow_sechand']];?></td>
                  <td align="center"><?php echo $type[$val['allow_housekeep']];?></td>
                  <td align="center"><?php echo $type[$val['allow_scenery']];?></td>
                  <td><?php echo $status[$val['status']];?></td>
                  <td><?php echo outTime($val['infotime']);?></td>
                  <td><div class="btn-group"><button class="btn btn-white btn-xs dropdown-toggle" data-toggle="dropdown">操作<span class="caret"></span></button><ul class="dropdown-menu">
                  <li><a href="<?php echo U('power/edit',array('id'=>$val['id']));?>" class="set-top">处理</a></li>
                  <li class="divider"></li>
                  <li><a href="javascript:;" rel="<?php echo $val['id'];?>" class="delete">删除</a></li>
                  </ul></div>
                  </td>
                </tr>
                <?php 
				}
				}else{
					?>
                <tr>
                  <td colspan="20" align="center">暂无数据</td>
                </tr>
                <?php 
				}
				?></tbody>
            </table>
          </div>
          <footer class="panel-footer">
            <div class="row">
              <div class="col-sm-12 text-right text-center-sm">
                <?php echo page($total,$p,'',20,'p');?></div>
            </div>
          </footer>
        </section>
      </div>
      <!--/ table 11 --> </div>
  </section>
  <!--/ main padder -->
</section>
<!--/ content -->
<!--主体 结束-->
<script>
$(function(){
  $('.delete').click(function(){
    var id=$(this).attr('rel');
    $(this).smoothConfirm("确认删除该信息吗？", {
      ok: function() {
        $.post('<?php echo U('power/delete');?>',{"id":id},function(result){
          $("#list_detail_"+id).fadeOut();
        },'json');
      },
      cancel: function() {
        return false;
      }
    });
    $("body").click();//取消弹出层对对话框的遮蔽
    return false;
  })  
})
</script>
<?php
include getTpl('footer', 'public');
?>